<include file="Public/head" />
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
</head>
<include file="Public/common_header" />
<div class="mian">
    <include file="Public/sidebar" menu="cljc.cldj"/>
    <div class="mianR">
        <div class="yuyue">
            <ul>
                <li onclick="get_list(1);set_priced(1);" class="yuCurrent">待定价</li>
                <li onclick="get_list(2);set_priced(2);">已定价</li>
                <input type="hidden" id="is_priced" value="1">
            </ul>
        </div>
        <div class="listBox" id="listBox">

        </div>
        <div class="clear"></div>
    </div>
</body>
<script type="text/javascript">
    function set_priced(p){
        $("#is_priced").val(p);
    }

    //获取url中的参数
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null)
            return unescape(r[2]);
        return null; //返回参数值
    }
    var curr_is_priced = getUrlParam('is_priced');
    if (curr_is_priced) {
        $("#is_priced").val(curr_is_priced);
        get_list(curr_is_priced);
    } else {
        get_list(1);
    }
    function get_list(is_priced) {
        /*if(is_priced == 1){
            $('#price').hide();
            $('#checker').hide();
        }*/

        $.get("/CarPricing/priceList",{"is_priced":is_priced}, function (data) {
            $("#listBox").html(data);
        }, "html");
        $('.yuyue ul li').each(function (i, item) {
            $(this).eq(i).removeClass('yuCurrent');
        });
        var curr_index = is_priced - 1;
        $('.yuyue ul li').eq(curr_index).addClass('yuCurrent');
    }

    function get_page(p) {
        $.get("/CarPricing/priceList?p="+p+"&is_priced="+$("#is_priced").val(), $("#searchFrom").serialize(), function (data) {
            $("#listBox").html(data);
        }, "html");
    }
    function search(){
        $.get("/CarPricing/priceList?is_priced="+$("#is_priced").val(),$("#searchFrom").serialize(),function(data){
            $("#listBox").html(data);  
        },"html");
    }
</script>
</html>